package cn.edu.zknu.mita;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;

import javax.servlet.MultipartConfigElement;

/**
 * Created by iwlnner on 2020/3/18.
 */
@SpringBootApplication
@MapperScan("cn.edu.zknu.mita.mapper")
public class MiTaApplication {

    public static void main(String[] args) {
        SpringApplication.run(MiTaApplication.class,args);
    }


    /**
     * 文件上传临时路径
     */
    @Bean
    MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        factory.setLocation("/tmp/mita");
        return factory.createMultipartConfig();
    }
}
